<template>
<view>
	<u-cell-group>
		<u-cell-item v-for="(item,index) in list"  :key="index"  @click="myEvaluation(item.classId)">
			<view  style="line-height: 50rpx;"  slot="label">
				<p>课程名称：{{item.name}}</p>
				<p>学院：{{item.collegeName}}</p>
				<p>班级：{{item.classId}}</p>
				<p>已分配督导人数：{{item.userArray?item.userArray.length:0}}</p>
				<p>已评价人数：{{item.list?item.list.length:0}}</p>
			</view>
			
		</u-cell-item>
	</u-cell-group>
	<drag-button :isDock="true" ></drag-button>
</view>
</template>

<script>
	import dragButton from '../../components/drag-button/drag-button.vue'
	export default{
		components:{dragButton},
		data(){
			return {
				list:[]
			}
		},
		methods: {
				getMyCourseList(){
					this.$u.http.get(`/myCourse/getCourseByUserId/f52da0c210424e63b30bf789185b3552`).then(res=>{
						if(res.data){
							this.list = res.data
							this.$store.commit("myCourse",res.data)
						}
					})
				},
				myEvaluation(classId){
					this.$u.route({ url:"pages/user/myEvaluation",params:{
						"classId":classId
					}})
				},
		},
		computed:{
			user(){
				return this.$store.state.user
			},
		},
		created() {
			this.getMyCourseList();
		}
	}
</script>

<style>
	page{
		padding: 40rpx;
	}
</style>
